package com.platform.support.json;

import com.alibaba.fastjson.serializer.ValueFilter;

import java.math.BigDecimal;

/**
 * Created by zhu.xiang on 2018/11/27 0027.
 */
public class BigDecimalValueFilter implements ValueFilter {

    public Object process(Object object,String name,Object value){

        if(null != value&&value instanceof BigDecimal){

            String formatvalue= String.format("%.2f",((BigDecimal)value).doubleValue());

            return formatvalue;

        }

        return object;

    }

}